package security.core.filter.handler.impl;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import security.core.filter.handler.LogoutProcessHandler;
import security.debug.RBACLogger;

public class RBACLogoutProcessHandler implements LogoutProcessHandler {

	@Override
	public void logout(ServletRequest request, ServletResponse response) throws IOException, ServletException {
		// TODO Auto-generated method stub
		if (RBACLogger.debug()) {
			RBACLogger.log("RBACLogoutProcessHandler#logout is called!");
			RBACLogger.log("loging out!");
		}
		HttpSession session = ((HttpServletRequest)request).getSession();
		session.removeAttribute("RBAC_USER_DETAIL");
	}
}
